//
//  addGalleryViewController.m
//  jingdongfang
//
//  Created by MTiMac02 on 2017/8/17.
//  Copyright © 2017年 kevinLY. All rights reserved.
//

#import "addGalleryViewController.h"
#import "IGTwoCodeVC.h"
#import "AppDelegate.h"
#import "AddDvViewController.h"
#import "IGMyCategoryView.h"

@interface addGalleryViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *image;

@end

@implementation addGalleryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.title=@"添加画屏";
    self.title=NSLocalizedString(@"Add iGallery", nil);

//    [self ig_setupRightButtonItemWithTitle:@"跳过" image:nil highLightedImage:nil];
    [self ig_setupRightButtonItemWithTitle:NSLocalizedString(@"Skip", nil) image:nil highLightedImage:nil];

    [self setUI];
}
-(void)setUI{
    
    UIImage *image = [UIImage imageNamed:@"igallery"];
    UIImageView *remindImage=[[UIImageView alloc]initWithImage:image];
    remindImage.frame=CGRectMake(0, 0, 200, 200*image.size.height/image.size.width);
    remindImage.centerX=KSCREENWIDTH/2;
    remindImage.y=KSCREENHEIGHT/4-10;
    [self.view addSubview:remindImage];
    
    UILabel * remindlable=[[UILabel alloc]initWithFrame:CGRectMake(0, 360, 245, 23)];
//    remindlable.text=@"绑定画屏,一键推送,即刻欣赏";
    remindlable.text=NSLocalizedString(@"Binding BOE-iGallery for One-key Push and Immediate Appreciation", nil);
    remindlable.textColor=[UIColor c5Color];
    remindlable.font=[UIFont systemFontOfSize:18];
    remindlable.top=remindImage.bottom+10;
    remindlable.centerX=remindImage.centerX;
    remindlable.textAlignment=NSTextAlignmentCenter;
    [self.view addSubview:remindlable];
    
    UIButton *addBtn=[UIButton buttonWithType:UIButtonTypeSystem];
    addBtn.backgroundColor=[UIColor appColor];
//    [addBtn setTitle:@"立即添加" forState:UIControlStateNormal];
    [addBtn setTitle:NSLocalizedString(@"Add Now", nil) forState:UIControlStateNormal];
    [addBtn.layer setCornerRadius:20.f];
    addBtn.titleLabel.font=[UIFont font16];
    [addBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    addBtn.size=CGSizeMake(GSCALE(300), GSCALE(44));
    addBtn.top=remindlable.bottom+20;
    addBtn.centerX=remindlable.centerX;
    [addBtn addTarget:self action:@selector(addBtn:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:addBtn];
    
}

- (void)ig_rightButtonPressed:(id)sender {
    if ([[IGUser getHasLabelSetting] integerValue]==0) {
        [IGMyCategoryView showIGMyCategoryView];
    }else{
        [Tool performBlock:^{
            [kAPPDELEGATE configTabBarVC];
        } afterDelay:.5];
    }
}

- (IBAction)addBtn:(UIButton *)sender {
    [UIViewController ig_pushViewControllerClass:[IGTwoCodeVC class] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
